package com.transcargo.geo;

public class GeoObjectNotFoundException extends Exception {
    public String msg = "";
    public GeoObjectNotFoundException(com.transcargo.geo.Object obj)
    {
        if (obj.isCity()) msg = "unable to find city with id " + obj.getCity().getId() + " of country ID" + obj.getCity().getCountryId(); else
        if (obj.isRegion()) msg = "unable to find region with id " + obj.getRegion().getId() + " of country ID" + obj.getRegion().getCountryId(); else
        if (obj.isCountry()) msg = "unable to find country id " + obj.getCountry().getId();
    }
    public String getMessage() {
        return msg;
    }

}
